<?
  include('../init.php');

  $project_id= $_GET["aid"];
  
  $sql = "DELETE FROM projects WHERE project_id=$project_id";
  $db->execute($sql);
  
  $sql = "DELETE FROM project_img WHERE project_id=$project_id";
  $db->execute($sql);
  
  if(file_exists('../../images/projects/'.$project_id)){
    remove_dir('../../images/projects/'.$project_id);
  }

  header("Location:index.php");
?>